Cleaning up the build toolchain, round 1

* better dependency tracking;
 * smaller Rakefile, configurable things moved to external yml files
 * split most of rake.rb mess into dedicated files.