refactor directory structure and add jasmine tests