added master/slave support to ORM models