major refactorings to support cloudos access and authentication to appstore