Added function to encode remaining length.
comment corrected.
added functions for pingresp, suback, unsubscribe and unsuback.