Refactoring of build system

Move contents of build.py to proper packages and subclasses to
prepare for other backends