Setup Karma/Jasmine for tests.

Fixed some test issues in PhantomJS.
Fixed a few cases where subtitles were using seconds