adds es6 to amd and fixes a problem with finding a longer path than needed