Refactored service loading, added security integration, minor changes