decoder now generated by a macro

still unconfigurable, baby steps
Merge branch 'master' into encoders
first attempt at acceptable interface for custom encoders