Add Base Middleware class.

Change-Id: I844a189afeb25cc9bbfd79d2948c35b26363af74