Restructuring, improved build system logic

Signed-off-by: Frank Mertens <frank@cyblogic.de>