Moved controls and DOM events to library

- Added the controls as seperate modules in the getControls() method
- Replaced the old event handlers with a single delegation for controls
- Replaced inline commit() call with an event handler/delegation