Changing sourcemap load process

Adds a check for external source maps linked from the compiled source. Modularizes the loading process.