Make it a proper Go contract, opcodes are fun until you want to change something in them. Part of #2412.
* Move generator to a separate package. * Move loader to a separate package and get rid of the code duplications.