change framebuffer from 2D to 1D
add a fill command to rect
clean up some code, closes #47