Added source maps for 'easier' debugging. Did some refactoring.