Replace setTestType() and setFields() with javascript getters/setters
Consolidate checks for valid argument in isFieldValid()
Fix location of valid8 require call
Reorganise structure of tests.init() and update test count
Update tests with correct error messages and to use new setters