Massive Refactor

Well. Things work so far. Quite a bit to clean up, though.

Using event listeners to pass gui actions back.