Added test cases to Packet and lots of small changes