Database: implemented SqlBuilder support for multicolumn IN statement

Also implemented workaround for Sqlite, which does not support this sql feature.
Database: fixed saving columns cache
Database: fixed refetching rows, refecth query contains primary keys [closes #1045]