Add Travis CI integration
Rewrite upgrade code

* Make it testable
* Make it useable as a library