(#13) - misc cleanup

switch a '==' to a '===' but mostly move as many functions as possible out of the constructor so they don't get redefined everytime.