[TableRecord] Constructor was refactored

* type of primary key field detection was automatized
* some things go faster now