Fix Asset statistics

Addresses bug https://bugs.launchpad.net/oq-engine/+bug/1213125

This pull request also includes some minor refactoring to the tests (I have moved the tests in scenario_damage_test and vulnerability_function_test in scientific_test, added some new tests to improve code coverage, etc.).