Longitudinal Phase Space Tomography and Its Implementation in Energy Recovery Linacs