Switch action handling to array methods.

Abandoned the crazy list comprehensions and otherwise hard to understand action handlers in favor of standard array methods. Dropped a bunch of unnecessary parentheses.