refactor HDFS state and it's tests

Refactor HDFS state and it's tests. Add CheckpointState as the super trait of it.

This first refactoring attempt is not changing any behavior of the origin HDFSState. The intention is to separate out the super trait, CheckpointState.

Also refactored the tests to remove code duplication.

I prefer provide the store as a parameter in the checkpointState by using composition instead of mix-ins. I was hoping to try out cake pattern which I just read about recently, as you said, I also don't see much benefit from it and seems a little confusing. Composition should express the idea more clearly I think