Improved the lerp() and lerp_seq() code.

In particular, lerp_seq is properly templatized such that it will
automatically deduce types.