More code clean up, move logic into Commands and out of the CodeKitState class
more code cleaning