ajson_reset: also reset input buffer and added a few comments