Exposes active submode through a function

Gets rid of the global variable and add documentation for the new API