Add support for postgres

With this PR we would like to bring support for PostgreSQL. 

* Most of the failures contained by the WorkLog and EventLog models
* Fix scopes with db function unique to mysql.
* Add `factory_girl` gem, as a replacement of `machinist`.  
  *(Maybe this should be a separate PR)*