Funeral held for Massachusetts teacher killed by student