Cleanup old and unused code
Add possibility to add ctx parameter to packet serialization