Splitting up some of the JS into different files and fixing building population