some fixes and code cleanup for wrapper module
added method url_encode() to functions.php for backward compatibility with WB; another WB compat. fix