Improve Baidu and BaiduIp lookup by fixing error and cover test.

*  fixes the error when calling messages in both Baidu and BaiduIp lookup because messages is not defined.
* adds some tests to cover more for both Baidu and BaiduIp lookup .