Some improvements to enable dojo custom build.