Implement flashmob model and tests for it

Also separate the code which closes connection pool from tests to
the separate file cleanup.js

Also add .idea to .gitignore