added a global marked variable, missing settings, and comments

the JSDoc comments aren't complete but it's a start
Merge pull request #938 from xt0rted/marked

added a global marked variable, missing settings, and comments