python packagisation: Move core implementation from __init__.py to core.py

@wmanley what do you think? (This is my last code reorg for now, I
promise.)

This seems to be more standard in python projects -- __init__.py only
imports what it needs to define `__all__`.

It also allows pylint to detect "unused import" errors, and isort to
detect imports not sorted according to the PEP8 coding standards -- in
both cases skipping files named `__init__.py` seems to be hard-coded
into those tools.