Still trying to settle on the right names for things, added a link type switch statement and added it as an option.
Fixed naming, spacing, etc and reconfigured helper functions to be a properties of a javascript object