Split out the boxdag and boxdag-rules implementations into separate files.