simplifiy transform interface

This commit rewrites transforms to be callable objects, since they
represent relations rather than objects.

Furthermore, rather than having a decode and encode method, transforms
must just be callable and accept the optional parameter ``inverse``
which determines the direction of the transform. This is intentionally
similar to ``sort(reverse=True)``.