Add Table.index method

Replaces Table.get_sample_index and Table.get_observation_index.

Also fixed some unrelated issues with broken code that `nosetests --with-doctest` uncovered.

Fixes #322.
Merge pull request #324 from ElBrogrammer/indexof

Add Table.index method