Implement some array ops, refactor

What, tests? Whaaa?