Remove some duplicated JSON parsing code

Signed-off-by: John Else <john.else@citrix.com>
Test the SR and VM owner types

Signed-off-by: John Else <john.else@citrix.com>
Remove a local module open

Signed-off-by: John Else <john.else@citrix.com>