Move server-specific stuff to server/compound.js
Refactor and speedup render