Update provisioning

Makes lots of changes and improvements to the provisioning system.