Group JavaScript object arrays on multiple properties