Faster tests

I've modified our base dao test case to implement the solution proposed in the sqlalchemy doc for unit testing.[1]

Basically, a rollback happens after each test instead of cleaning up the whole db.
fix some problems that appeared by not using an empty db
fix a helper in test_dao that did not return value of the good type for comparison with the dao results

1. http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html#joining-a-session-into-an-external-transaction-such-as-for-test-suites