Moving around resource factories, removing outdated middleware from the advanced example, adding basic CORS support.