Merge pull request #3 from qwertyzzz18/upgrade-database

Added database upgrade script
Merge remote-tracking branch 'upstream/master' into mine
Continued to organize graph.
Added database upgrade script

upgrade-database.py detects the version of the database, and upgrades it
if necessary.
Merge remote-tracking branch 'origin/master' into mine