Framework Cleanup and Mouse Support

Cleaned up a lot of the extra code. Rewrote requires to make more sense
and be a lot simpler. Cleaned up the global space and put everything
into anonymous closures. Added mouse support. General reworking and
refactoring into a much cleaner state.