Refactor site.ts so that the viewmodel does not need references to data/self