Optimisations to map copying, improving performance by three orders of
magnitude (now takes minutes instead of days). Removed GORM, reduced
number of database calls and does everything in one database session.

Also now wedded to MySQL, since we use REPLACE rather than INSERT.
This gets around the problem of sometimes getting duplicate locations
when scaling tiles.