Split buffer.rs into various sub-modules for better organization.