Move buffer.go to its own file