Some more fixes to hive commands.

Summary:
* Adds ability to retrieve paths for tables.
* extract out hive_cmd() function.
* fix a syntax error.

Notes:
* I think having the new hive_cmd() should make the targets fairly
  easy to unit test. We can discuss if you'd like.