Refactored compare.js to use a makeshift 'spaceship' operator, simplified sendAction in component.js

1 var per assignment statement please (makes setting break points sane)