app.js -> js/viewer.js
don't define function in loop
Merge branch 'master' of github.com:paperhub/paperhub-frontend

Conflicts:
	app.js
merge conflict