intermediate refactoring
fix test
additionally write sourcemap info as json