Refactors tests and adds ScalarTests file