Refactor into separate modules

Refactor monolithic hl7 module into separate modules, same with tests.