fixed parser, made scan/parse available as library