Filter out code that isn't actually used, also add build scripts