Makes lexer case insensitive

The lexer is now case insensitive; it converts all tags to lower case as it processes them.
Includes tests to check the behaviour and some test code cleanup.
Merge pull request #3 from arjank/master

Makes lexer case insensitive