Added function get_field_groups() and improved the get_fields function

Signed-off-by: Elliot Condon <e@elliotcondon.com>