JSGI middleware composition layer and application framework