Refactor location generators to add support for Magento and keep things DRY.

Signed-off-by: Ben Corlett <bencorlett@me.com>