Refactored build, added sourcemap support.