Move code out of __init__.py

Both for convenience (pylint disables some checks in __init__py) and
to adhere best python practices.

Change-Id: If06cf87f7425a4c2036af17a1b3965c7e2339f5e