reorganized code
configured karma to work by reading javascripts from index.html