Refactor out duplicate getAppInfo code to view/lib/appinfo.js

Related to #202