Added support for humidity reading.
Did some minor refactoring.