refactor(globaltocjs): renamed functions and improved documentation