Initial steps for unit testing FE

Refactoring:
- Moved vendor specific JS codes to separate library
- Sperated event handling mechanism from utility functions.
- Minor modifications of the JS code.
Basic configuration for Jasmine and Karma.
Includes Boldi's commit.