Fix the maxItems problem for array type, and rework related code, for joshfire/jsonform#119