Higher level test for db backends.

This patch implemented the blueprint test-db-backends, and also fixed
the bug 1085111.

Note: Some test cases in RawEventTest are still db backend dependendant
due to the bug 1101100. We could move them to base class after we
resolve that bug.

Change-Id: Ic32a7f0719d34a008cc21ddd59c9912d9a90db24
Corrected get_raw_event() in sqlalchemy.

This fixed bug 1101100. The returned dict of get_raw_event() in sqlalchemy
should be consistent with one generated by
collector.meter.meter_message_from_counter().

Change-Id: I6948fdbd0c1e03d46be7d3a05faa53ca70698ce8