Improve the Rule API, and add many tests

Added tests for HMap

Actually add the tests

Get the tests passing