improve close_circuit exceptions

Damian,

These changes improve the error reporting when there are problems with close_circuit by using InvalidArguments when appropriate. The two commits are: the improvement, then the tests of the improvement.

Please pull from the fix-closecircuit-exception branch at git://gitorious.org/stem-robinson/stem-robinson.git or view the commit logs at https://gitorious.org/stem-robinson/stem-robinson/commits/fix-closecircuit-exception

Trac:
Username: robinson