Try to implement clientside API for otps that is both backwards compatible and has the ability to be efficient.

This is a pretty big patch and a pretty big change.  Take a look and make as many comments as you feel like.  I can add more comments, improve the documentation, or whatever you feel is needed.