Moved dumping functionality into an Export class

This commit extracts the dumping functionality in Locale, making it more reusable. This is required for one of my use cases.