Javascript test refactor / improve coverage

Removed a couple of unused methods on DoughBaseComponent
Added some coverage
Reduced duplication in tests
The only change ;)

Adding the space after function. Isn't the styleguide `function() {`?