Added hash_test! macro to simplify writing of hash testcases and converted all existing tests to it