Update hrecipe_format.js

* Created an object containing element_id, name values to reduce
  code
* Pushed values to an array instead of manually joining the values
  together
* Added an option to return an array of values OR a string of
  comma separated values