Revert "Revert "Fixed packet send callback design issue""

This reverts commit ead08d6e5b5eb66012950805ef088e1a8efd47ea.
Fixed send callback test failures
Added a test case which makes the code before the send callback fix fail
Fixed bugs in previous send callback fix and updated test cases
Merge pull request #132 from roamm/send_packet_callback

Fixed bugs in the previous send callback fix and added new test cases