Refactored code from grabbing sitemap id into function.

Created a `get_sitemap_post_id` function that gets the WP post id for a
sitemap with a given date as this code was being used in several places.

From comments received on #64