Added handling for undefined errors and test coverage

Fixes #1827

If `error.logError(err, context, help)` is called with an undefined or null `err` parameter, the message 

> An unknown error occurred.

is displayed, instead of the error handler blowing up.  Added test coverage for this case, as well as cases with a null or undefined `context` or `help` parameter (these cases were already working but not tested).