Moved initial map loading into a separate python file.
Moved some operations into functions.