Refactored tests, added test for computeGeneralExpectation bug

I merged the nearly identical files for the harmonic oscillators and exponential tests.  This cuts out lots of redundant code.  

I also copy pasted the new docstring example from #100, so that we have a nose test for this bug--IMHO it's dangerous to rely on doctests, as they are somewhat less robust than nose.