Document and unit-test the signals.

Adds description of signals to docmentation. Adds unit-tests of
signal behaviour and tests parameters.
Add some more tests of signals
Minor style fixes
Merge pull request #64 from eskil/signals

Document and unit-test signals.