Exporting source maps

Please review the code in the meanwhile. This is not ready to be merged yet.
Why is this mapping happening here? It is time consuming and shouldn't be used unless necessary.