Exporting sourcemaps

Fixes #30
Not really this PR issue: This function is one spaghetti mess and would deserve a refactor in a future.