Generate useful code

Added baseclass option (generated classes, partials will inherit from
this class)
Setting global namespace will correctly use global:: instead of global.
Added ToProto, FromProto helper functions