Allow using tables and views

pulled out of #31

I don't use sqlite3, but this looks like a simple enough change to merge in.

Comments?