Switch to using objects instead of classes for usercode

Whole stack is changed so that input/output formats and PACT contracts,
respectively their builders, accept objects instead of classes for
usercode.

This change is necessary to allow the scala frontend to generate
usercode objects to pass to PACT contracts.