created FriendlyError middleware

this addresses #1

would appreciate a thorough review from @cdent (see commit message)