Implement stricter whitespace rules
greatly simplified the whitespace parsing code
Fix testcases