Experimental extensions implementation

This is just an experiment to see what extensions might look like and also to get a better understanding of all the nooks and crannies of the problem.  This is based on a suggestion from @xymostech in issue https://github.com/Khan/KaTeX/issues/90.
The extension turned out to be pretty clean and encapsulated.  The custom lexer needs to know a little bit about the internal works of Lexer.js.  This could be improved by adding a method called .getInput(pos) maybe?