Rework buildscripts for better structure, and begin infrastructure for logfiles