Development of an IoT Environmental Monitoring Application with a Novel Middleware for Resource Constrained Devices