Change output system & add quiet option

Add functions to print output depending on loglevel.

Add -q option to reduce verbosity. Quiet and verbose share one status
variable so they counter each other.
Modularize and improve options, input & output

Clean up main by moving option parsing into options modules
parse_options function.

Improve options module by storing flags as separate bits and adding
generic flag_get, flag_set & flag_unset functions.

Improve output system by separating flags and loglevel.

Modularize input management using input module.