Answers issue #97. Make Collate a Pluggable function.
Can pad on different directions(left, right, bottom, top). If dual variables are set to true (i.e. left and right), pad on both directions.
Also adding the small fix proposed in #142 (see transform.py)