Make sure to install psycopg2 when needed
Return tenant models by their class definition order.

This also fix an issue with python 2.6.