Moved encode into Converter class, use json_field instead of jsonfield
Added tests for converter