Ordering bug and output bug

Further clearify the ordering of nodes when constructing the HCT.
Internal nodes would now inherit their left children's symbols. Output
flush() would left shift every written bit so that it would not create
a different code at the end of file.