Re-ordered function params.

No functional change, but more idiomatic Erlang.
Updated web test to new error return.

Cleaned up escript headers, comments.