Added optional 'done' callback to compile() method