Merge subject parsing into class

Merge the various subject parsing functions into a `SubjectParser`
class.