Minor formatting edit.
Created separate "error" and "usage_error" functions,
to report error differently depending on nature of error.
Made error message print to stderr instead of stdout.