Restructured files and added karma/jasmine for testing.