Add easymock tests, use the pooling http client connection manager. Be more defensive around possible exceptions in getFlag