Adapt core build system to allow building out-of-tree

Simply define `BUILDDIR` to where you would like build output to go.

This is a draft of what we discussed in #95.