Re-wrote version control to handle added security groups

* Added UT for version control
* Re-wrote exception logic