general refatoring of a few functions
now using set function for some attributes
set function now used in goal to reduce repeating of autosave calls
ternary for attribute assignments
connected method now used in remove connection to hide messy conditional
comments cleaned up
Merge pull request #81 from shidel-dev/js_refactor

Js refactor