Designing and Prototyping a Middleware for Vehicular Networks