wrap non-function code in a __main__ function

This doesn't add any code to actually run the `__main__` function,
but now it converts correctly.

See #29 for context.