Removed large amounts of redundant code

Removed commented out code, and code that isn't being used.
Changed the triggers to be level sensitive

jpallister's patch.
Trigger was originally edge sensitive.