Cleaner SQL script, together with new tables. Dummy implementation of LOC cmd.