Fix associated_buckets

Fix the associated_buckets function to actually return bucket names.
Reduce the copy & paste, move to common location.  Add check to index
admin test.