Rewrote JavaScript to consist of separate classes for Lightbox, Output and Layer.

This allows for easier to follow flow of information and easier attachment of events to update colors and the like.