Modify Transformation interface

This changes the Transformation interface from simply requiring
``expand`` to requiring ``encode`` and ``decode``, where the latter are
inverses and ``decode`` performs the same role as ``expand``.
Merge pull request #27 from Ceasar/transformation-api

Modify Transformation interface