Session renewal fix + record versioning fix + postgres fk reference fix

1. When there is no session and sessions are stored on db by settings, login_user() failed because it tries to renew an None session.
1. record versioning must skip tables without '_id' field.
1. postgresql "reference <table>.<field>" fix on "keyed" tables i.e. with "primarykey"