bugfix: wrong variable name used in waves_to_bed.
Bugfix: height and st.dev were flipped in wave to bed.
Add missing close() function for calls to open connections to the
database.
Bugfix: flip signins in statistics, which was causing incorrect
behaviours for peak comparisons.  Flip corresponding signs in
FindUniquePeaks, which now seems to be working.  Further work required
to ensure correct results are being generated.