Moving tests to a new file

Also fixing syntax error in a unused/untested function