Minor improvements to Table class and add tests

This pull request includes the following changes:
- Replace `ElasticsearchIllegalArgumentException` with `ElasticsearchIllegalStateException` which seems more appropriate.
- Add a few more preliminary checks to some methods. Some may be too pedantic and may not worth it. Feel free to remove those
  if you think the little overhead is not justified.
- Add unit tests for the `Table` class.