Implement "forEach" utility method

I implemented this while working on `Account#shutdown`. Should be useful elsewhere