Entities Test and Code Analysis

This change contains no product changes. Instead:

1) Adding dev-test for the entities/database project with 91% code coverage.
2) Enforcing Code Analysis to succeed in entities/UI projects. If Code Analysis introduces warnings, the build will also break.

Code reviewed by Charu. Basic test performed.

Code Review: http://mrccodereview.cloudapp.net/ui#review:id=1083
Deployment: http://cz-july2013-javierluraschi-fixes.azurewebsites.net/