Split write_tile_config() into generating and saving methods.

Additionally, setting an output directory is now possible as well (optional).
Add description for write_tile_config().
Clean up TODOs.