Huge performance increase

all regexps are replaced by either sets (maps) for lookup and a function
for whitespace removal