Utils: added is_localhost and tests.

resolves issue #89