Big refactor to enable multi-project support.