Improvements on copy/paste operations.

Object dependencies form now can list indirect dependencies.

Minor fixes on databasemodel on retrieving dependency/reference for
objects.