Use unit instead of {} in generated code

Resolves #501.

I wasn't really sure where to put `jsUnit`, `JS.AST` is probably not the right place... any thoughts?