Added byte writing functions to MCBuffer and used it to generate packets