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

@zackkitzmiller this isn't ready to merge (it's got tests, but I haven't actually tested it...), but would you mind taking a look?