SERVER-13259 moved upgradeCheck()'s index key size checking logic from javascript to c++

previous javascript logic was wrong and to correct it we needed to move it to c++
also fix index size logic and add warning about non-V1 indexes
upgradeCheck() test added
Merge remote-tracking branch 'upstream/master'