Big refactoring
Merge pull request #5 from RafLeszczynski/hist_test

Big refactoring