improve tests, init log4j, better rate limiting