Improved technique for finding if method is defined in DOM. version updated.