fixed calcDifficulty by making sure the MAX_TARGET is also locally available.
added tests for 2 difficulty calculations.