Add some functions for converting datasource metadata to JSON

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