Base: huge cleanup

*) catch unregistering receivers to prevent crashes
*) remove unused imports
*) remove unneeded semicolons
*) manual array copy
*) string comparisons with == instead of equals()
*) unneccessary boxing and unboxing
*) codestyle
*) update gradle version
*) much much more

Change-Id: I9eb301d2096dffdda6b403e1e16fcc00e56e1e55