moved initialization logic to separate module

this avoids import weirdness while keeping `__init__.py` free of logic
(so things like `setup.py` can use its metadata without worrying about
side-effects or circular imports)