Big refactor to change the way dependencies are handled.