Toggable debug mode added, began work on a basic player. Oh, and more code tidying.