implement args_options functions

Signed-off-by: Mattias Andrée <maandree@operamail.com>
m + doc

Signed-off-by: Mattias Andrée <maandree@operamail.com>
m

Signed-off-by: Mattias Andrée <maandree@operamail.com>
m

Signed-off-by: Mattias Andrée <maandree@operamail.com>
typo

Signed-off-by: Mattias Andrée <maandree@operamail.com>
missing variable + make some variables static

Signed-off-by: Mattias Andrée <maandree@operamail.com>