Fix hex.js to be correctly parameterized.  Add documenation and example.