script to generate maps and dump to a file
Add function to load map from reader stream