statedir compile time option

Soliciting feedback / commentary / thoughts from those who know better; still very much a WIP and something I'm wading through.

Mainly useful to package maintainers... I personally need to see a state/ dir compile time option to finish packaging cfe for openwrt. For me an option like this would help isolate [frequent] writes away from flash and toward something more embedded friendly, like tmpfs/ramfs.