A PAC pattern based javascript framework