Formation of hydrogels from cellulose nanofibers