Initial implementation of documentAttached/documentDetached.

Switched widgets over to using view/viewmodel naming pattern.