Clean up CodeItemAccessors and Compact/StandardDexFile

Change constructor to use a reference to a dex file.

Remove duplicated logic for GetCodeItemSize.

Bug: 63756964
Test: test-art-host
Change-Id: I69af8b93abdf6bdfa4454e16db8f4e75883bca46
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index c91240e..f817def 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -944,7 +944,7 @@
                class_it.Next()) {
             if (class_it.IsAtMethod() && class_it.GetMethodCodeItem() != nullptr) {
               for (const DexInstructionPcPair& inst :
-                       CodeItemInstructionAccessor(dex_file.get(), class_it.GetMethodCodeItem())) {
+                       CodeItemInstructionAccessor(*dex_file, class_it.GetMethodCodeItem())) {
                 ASSERT_FALSE(inst->IsQuickened());
               }
             }