added check for valid histogram and one for valid json
adding npmignore
much improved unit tests