Conditional check on get_index_name

Only return an index name if passed a valid blog_id. Added relevant tests.

@tlovett1 #reviewmerge
Removes null items from the array, thereby preventing unnecessary commas, i.e.:

w/o array_filter:
`$index = ',index-name-1,index-name-2,'`

versus w/ array_filter:
`$index = 'index-name-1,index-name-2'`