Rename bounds checking methods
Add more input value error checking
Remove obsolete code
Change how bin positions are mapped

At the same time make test code better