Small fix.
Add support to PUT and DELETE list of entities in RWS

Sending a PUT request with an empty entity key will cause the request
to be treated as a list (actually, a dict) to be merged with the data
on the server. Similarly, sending a DELETE request will cause all
entities (of that type) to be deleted.
Fix small syntax error in RWS
Fix small error in cms.conf.sample
Make SS initialize the RWSs with a constant number of HTTP requests.
Fix typo in ranking
ranking/client/DataStore: reestabilish EventSource when connection fails

If the connection fails due to network errors, the specification
mandates that browser don't attempt reconnecting. In that case, recreate
the EventSource manually after a fixed timeout.
Fix some data consistency checks in RWS
Make RWS reject requests that would make it inconsistent

This includes:
* creating or updating a task with a non-existing contest
* creating or updating a user with a non-existing team
* creating or updating a sumbission with a non-existing task or user
* creating or updating a subchange with a non-existing submission

In addition, deleting an entity will cause all entities referring to it
to be deleted too.

To accomplish these two goals we needed circular imports. The only way
we found to make it work was to use local imports (i.e. `import Foo')
instead of global imports (i.e. `import cmsranking.Foo as Foo'). Any
suggestion on how to use global imports is welcome.

There are also a couple of bug fixes in Scoring.py.
Avoid deprecated psutil methods if the new version is available.
Added UNIQUE constraints to the DB.
Can run tests also for installed cms.

Changes: CONFIG_DIR is absolute (and not relative to TEST_DIR);
TEST_DIR is None when we are testing installed CMS; no python-coverage
for installed CMS.
Exponential time delays checking for services to come online.

(Also merged common code for starting services and server.)
Also checking for RWS to come alive during tests.
Adding REQUIREMENTS and more adjustements for pip.

- Added a REQUIREMENTS with pip syntax;
- fixed permissions of package data with pip;
- updated documentation to use pip.
ES does not crash if a task has no testcases.
Fixed a nasty bug in user update and take advantage of unique keys.

- username can be updated too;

- no python checks for duplicated username (since there is a unique
  now);

- always check for integrity errors when committing and display the
  error to the admins.
AWS asks SS to resend data to RWS when some relevant data changes.

This is preliminary support, and does not handle deletion of things
(well, AWS doesn't too), in the sense that, RWS keeps displaying
them. More important, if a task or a user changes name, RWS create a
new task/user and treats the two as different. Need to talk with Luca
on how to solve this.

It seems safer anyway to act more directly for an important contest
(i.e., stopping SS and RWS, clearing RWS data, restarting both).
Updated TODO.
Reenabled threaded on precache, and don't cache executables.

I couldn't find problems with rpc_threaded precache. In case, we can
comment it out again.

As for not caching executables, it is "necessary" for long contests
(e.g., months) where the number of executables can be huge and the
admin does not want to waste GBs of storage for nothing. (Without
precaching them, it is possible to delete the cache and the worker
won't download them again.)