[DO NOT MERGE] Initial commit of refactor. Still contains old code.

COMPONENT_INSTALL_ORDER seems to be no longer used.