Fixes reference type
Adds convertArrayToPhp method, which accepts data from database and
converts both field names and values to PHP environment
Adds value conversion for queries, where fields are fetched instead of
complete objects
Adds some new tests