Factor out some common buffer code and use it to implement DynamicIndexBuffer, start on sprite system, fix input bug.