Added headers to tx packets and refactored module.