untested lexer implementation, also added build script and moved lexer functions to a separate library