moved generated target directories around, changed formatting scope, fixed some bugs

Signed-off-by: dvorkinista <villain@noironetworks.com>