Added lots of static type checks on ReaderM and State