More Tests, optimizations, refactors and less use of regular expressions
Merge pull request #390 from Ahimta/master

More Tests, optimizations, refactors and less use of regular expressions