Improve build infrastructure

Split build configuration into more files with the intent of making it easier to understand.