Change version datatype from uint64_t to int64_t due to problems on OS X 10.8 and the fact that the SQLite datatype INTEGER is signed. Tests passing

Maintain backwards-compatibility
Do not begin a transaction before checking the migration version

Signed-off-by: Clemens Gruber <clemensgru@gmail.com>