Conditional check on get_index_name

Only return an index name if passed a valid blog_id. Added relevant tests.

@tlovett1 #reviewmerge
Question on this @tlovett1, would it be better to combine this with the preceeding test or to have tests separated?