Changes to allow km and m data to be stored in the database

Binaries included in the commit as it doesn't seem to make any difference if they are included or not. Hope it doesn't cause a problem.