modRest flexibility

Some changes to get object or array JSON result and response headers via setting config keys and/or overriding methods + 1 bug fix.