Can we refactor it so it's usable in server-side NodeJS apps? Can we replace document and window objects with wrappers?