Exporting source maps

Please review the code in the meanwhile. This is not ready to be merged yet.
Will do.