Implement rate-limiting

http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#rate-limiting
as a follow up PR, we should probably create a plugin process function for each plugin type. Would make doc look nicer.