added a global marked variable, missing settings, and comments

the JSDoc comments aren't complete but it's a start