Moved tests to separate js file