Tighten up code for rake api tasks, and move common get_node get_group and get_class methods into a shared helper file.