build: output directories
fixes: logical fixes and build system improvements
doc: first draft