Add support for various constraints, restructure around adapter mechanism, implement rapidjson adapter.