store_package migration to master

This is a work-in-progress pull request to move the package upload method to warehouse, similar to #293.

I'm sending a WIP so I can get some feedback before I continue further. Things left to do are:

* writing tests for the db methods
* re-organizing packaging/db.py to be a little bit clearer
* pep8 / flake8 cleanup