Refactor parserTests so the class can be used by another script