big cleanup - remove Permissions.jar (obselete), remove unused imports, fix a bunch of warnings (suppress "unchecked" where deliberate, remove some unused variables), declare final variables per Eclipse