allow passing a map database to `register`

fixes #2
stylistic adjustments
added spaces for `if`s
move `else` on the same line as the `if`'s `}`
Merge pull request #3 from fb55/master

Allow passing a map database to `register`