Moved all core code to __init__.