Arrayformula

Rebased my array formula changes on the new master, and added in some tests.