Model redefinition

I go back to integer type primary keys. Also added a nullable foreign
keys in Note entity in order to relate to Organizations and Projects.