do compression in separate method

the dobackup method is too long and compression will be reused
by a future method to do special backups.
also removing the old code for deleting tar.gz files
wrong starting index in boolean array
don't access the boolean fields of appinfo directly

proper methods for getting the values of the boolean fields of
appinfo are now implemented.
system and install don't have setters since those values can only
meaningfully be set with the values from the packageinfos when the
appinfos are instantiated.
fewer parameters in writeLogFile method

the version of writeLogFile which takes many parameters is only
kept for writing from the legacy logs. as soon as the old logs are
deprecated there will only be one version of writeLogFile.
make check for subdirectory and old apk file more compact

there's no need for the second if clause to be on a line by
itself.
fix method to set new backup mode

values should only be added if they are different and neither
is above MODE_BOTH.
this fixes a bug where the value would keep increasing if the
values are equal.