Adds warping functions. Also includes some refactoring. Change-Id: I909830650f29046edf108ddaddceb1a5e7c6c61c