Scalable javascript applications architecture