add buffer support
remove un-needed imports
Merge pull request #519 from luvit/add-buffer

add buffer support