First pass at an image histogram, serial right now

This populates the histogram, blocking the main GUI thread right now.
Simplified the calculation code slightly

Added an assert to ensure we catch all points, removed debug/left
over code and simplified the templated function slightly.
Use a background thread to calculate histograms
Merge pull request #5 from cryos/histogram

Histogram