First pass at getting activate/activate properly deactivating
Refactor common code into a shared function script instead of another command
Move functions over to shared function file