all: Refactor config names

Refactor package definitions to avoid conflicts with config.h's from external
libraries like Thrift. Theirs usage is also updated and optimised when
necessary.


Change-Id: Ie8cdba5d4568dc28e16e4b91b2bebe5a893be635