Tweak some code formatting
Make main() less special-cased for __name__ == '__main__'