refactor writer class to expand API

add `add_table` and `write_row`