Support image classes filtering in image writer

New logic prunes classes that have any dependency on a non-image
class. This enables creating smaller images with class profiling.
Code is from class profiling CL.

Added a CHECK for guarding against creating an app boot image with
existing boot image(s).

Bug: 22858531

Change-Id: Id5f38c8122e67141b851d0f41b68d2ffd07280d0
2 files changed