LightSwitch Extra Credit - Version 2

Cleaned up code. Added tests. Fixed a few issues.