fixed util.calcDifficulty

the `MAX_TARGET` var used was exported but not accessible by the calcDifficulty function.

also added 2 simple tests for it to have a little bit of coverage on it.