Clean up emit_object/2 by moving an if to the toplevel and using a match construction instead.
Merge branch 'work'