Expose the current mode stack length.
(cherry picked from commit 5dc345261d985ce8373b22833f3f29a6c81fb698)
Merge pull request #5 from roguenet/expose-mode-stack-length

Expose the current mode stack length.