fix scan bugs for eof
table tests
fix more eof bugs
refactor out cs var and eof label
test for io.ErrUnexpectedEOF