Major cleanup of bootstrap and code