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.

Pleace check them asap and give me a feedback so it didn't break anything.

Cheers