Some urgent restructuring and adding of dependencies to make it build again.