[WIP] add support for secondary indexes

TODO: Support indexes without a hash, by substituting an int column that defaults to 0 or the like.