turned rhtable_next into a mutator function
added a typesafe way to use the table.
updated test program to typesafe version.