refactored to remove the context, added version handling, moved permissioning to its own package, refactored new and load clients