Replaced the pickle reg db with simpler flat files.

Closes #327
Added a script to upgrade old-style reg dbs.
Handle corrupted reg db files.
Fixed a reg function name.
Merge pull request #764 from hjoliver/replace-regdb

Replaced the pickle reg db with simpler flat files.
Fix path to registration DB

Looks like #764 misses 2 places.
Merge pull request #765 from matthewrmshin/fix.764

Fix path to registration DB
Hot Fix: don't abort the DB upgrade script if a new DB exists.

This affects only the new upgrade-db command. Any cylc db operation
creates a DB if one does not already exist, so the upgrade command
should create a new-format DB if necessary or otherwise just re-register
old suites in the new DB.
Merge remote branch 'upstream/master' into expand-battery-8