cleaned up a shitload of the old code
minor fixes to the API
cool, got the window running
modularized the functionality, separating state powers. Could have been
better, but I just wanted to get this to work.