Simplify compiler code path and add support for sourceRoot.

The sourcemap sourceRoot is a common prefix like a baseURL for the
the filenames in a sourcemap. It allows the map to be more compact by
reducing the number of repeated strings.

Sorting out how to set this was hampered by the compile chain complexity
at the "write" end of the chain. Reducing functions and callbacks makes
things clearer.

Fixes #1324 and fixes #1310 
Done (I find this specialized asserts tedious to recall since different test drivers have different special functions and the value they add is small as far as I can tell).