Added expandPattern method
expanding alternations
added getExpandedAssertions
Moved sorting of expanded patterns to tests
expandPattern also returns flags
replaced regexp matching with string lookup