Refactor middleware.json

Change the format of `middleware.json`:
 - reduce number of keys and nesting
 - allow multiple instances of the same middleware

Sample:

        {
          "routes:before": {
            "morgan": {
              "config": ["dev"]
            }
          },
          "routes": {
            "loopback/server/middleware/rest" {
            }
          },
          "subapps": {
            "./adminer": {
            },
          }
        }