John Gregory has signed a new two-year contract to stay on as manager of League One side Crawley Town.