Set version in __init__.py.

Also minor code cleanup.