Extract a parse function out of the generate fn

This allows a third-party user of the library
to use the not yet compiled strings for certain things.
Merge pull request #63 from mila-labs/refactor-gen-extract-parse-fn

Extract a parse function out of the generate fn