Buildings on a St Andrews University campus are to be demolished to make way for a new learning facility.