Separate engine from gui/prefs

Don't feel obligated to merge these changes, but in addition to trying to feel my way around github, I've been wanting to separate the gui/prefs stuff from the 'engine' for a while. And in my dream world ... the engine (the 'lib' folder) would be its own git project/repository which could then be added to other projects (the gui wrapper, sigil plugins, calibre-plugins, etc) using git-subtree or git-submodule. Adding the __init__.py to the core folder would be a step toward making the core code a standalone, importable package (without the gui).