Import more ok'd parts of ALAC encoder from GSoC repo.