Added more argument validation in various classes

Also wrote a class called SidHeader, which validates headers of SID
messages and exposes the message type and message length.