KH-183: Some additional test coverage

Mostly for KH-187
KH-187: Check that code exists in latest codes

ALso use buttons instead of anchors for "Edit buttons". Disabling
anchors does not prevent their functionality. Removed all the
possibilities to edit or delete relations in viewcodes and
viewcodeelement views.