Add spec tests and refactor module for 1.0.0 release