Added tests and renamed wrap-user middleware