lib/flags: rename to ScriptFlags
doc: add docs to lib/flags