Clean up and consolidate _get_object_list

This commit consolidates code in _get_object_list in preparation
for supporting other objects (NodeBalancers, domains, etc.).
patch for reported StackScript error
Fix errors on older Perl versions