Refactored gradeDecoder to be in lib directory and improved module export

Refactored gradeDecoder require in test