Multifunctional compounds for forming crosslinked biomaterials and methods of preparation and use