Moving a few more routines from matrices/ into src/