I've decided to write ftn-tosser based on separated libraries:
First movements are packet parser and message serializer: