Move buffer functions the the c file
Add buffer init function body
Add buffer flush function
Add buffer function for appending char