Move rect calculation to its own method
Sanitize layer names before exporting. Closes #13