moving parsing code to a module

In oder to be able to run moonscript in an embedded lua environment it is needed to move the file parsing code to a module, so that  C++ code can call it via lua C API. `moon` binary invokes the same function