Fixed some mem things, found an odd parsing bug where a // comment before a function definition at top level does not parse. Deferring for now.