Modal bugs, code cleanup

* Directive too slow sometimes, modal object needed at page render.
* Fix modal bugs at view page
* Added confirm delete modal