Canonical bases and higher representation theory