Move tree writing code into bitwriter.h. Rename av1_write_tree() to aom_write_tree() and move it into bitwriter.h to match aom_read_tree() in bitreader.h. Manually cherry-picked from aom/master: 33a143fa7ac42d62080bfc20468cb76ad26045db Change-Id: I6c686cdd3e0f179d7e95c5bc6984558b62d46d67