add middleware function, change Extension api.
update submodules for 0.16.0.
update examples for 0.16.0.