Break up scanPackageDirtyLI

Instead of having a single, thousand line method, break it
appart into several hundred line methods. Also, try to bring
order:
1. separate policy
2. separate package validation
3. separate package commit
Also inspect each block of code and determined which code needs
moving [in future changes].

Bug: 30219944
Change-Id: If028f692acf6c259e7140a770d61a717a3e9362d
Test: manual
2 files changed