Refactor core logic into api.py

This has a few benefits:

* You can use sixpack within a python app with `sixpack.participate(...)`
* It's a bit easier to test
* It paves the way to add programmatically accessible analysis APIs which I'm thinking maybe a good way to address stuff like https://github.com/seatgeek/sixpack/pull/112
Merge pull request #117 from seatgeek/python-api

Refactor core logic into api.py