Added support for closures and made the parser/lexer reentrant.