Refactor scripts

Correct lib script paths.
Move view refresh handlers to app.js
Generalize view refresh handler assignment over element data attributes.