Framework for distributed javascript applications