add buffering to MemwriteEngine, and coalesce the vector and scalar implementations