Changed file structure and added some mocha tests