Large code cleanup:

1) Decoupled the Javascript and HTML a bit more
2) Cleaned up the CSS a little
3) Made the Javascript a bit more readable, and efficient
4) Moved from delegate to on (per the deprication of delegate)
5) Etc bits of cleanup / optimization