Code cleanup, fixing null pointer checks, moving code around

Moved out some dead code from different places; started work on GamePlayState to take place of MapTestState but with better quality.