move viewify stuff out of index.js