make memory init code a bit nicer
support per-dir flag overrides/extensions