Refactor compact dex writing

Refactor compact dex writing into compact_dex_writer.cc, change
dexlayout writing logic to use the header structs instead of having
an array with indicies.

Bug: 63756964
Test: test-art-host

Change-Id: I58879aefc1672c965789ee539450986c9d830c82
8 files changed