Structure and interactions in covalently and ionically crosslinked chitosan hydrogels for biomedical applications