Factored loadmap() and associated functions out of liquidcacontroller.js.