Revert "Use cm.getModeAt in getModeAt"

This reverts commit 6776bc0d6f17b6d13f7cf92d312fbb243c954d95.