Fix the way we decide if hasNext is true or not in WALReader. Unit tests...

... for all classes.
Since these are functions only useful for testing WAL, its best to put them in the same file as the WAL.