Basic game functionality update.

Simply added and fixed a few of the base game functions and improved the code a little. Should be able to start on levels soon enough.