Add batching interface and trait

Summary: Abstracts a lot of the common funcitonality found in batching.

Test Plan: Run unit tests

Reviewers: brooke, JayFrancis, rgooding

Reviewed By: rgooding

Differential Revision: http://phabricator.cubex.io/D31