Refactored for easier implementation

Made it easier to use, no need to specify fields - you now get the JSON
record and can access it's properties directly, returning an array of
controls to the calling function.