split main.coffee into subfiles and improved ui logging and tile spawning