Add a test for `expand`
Change some tests in test_functions.cpp so the tests pass
Replace Mul::dict_add_term by Mul::dict_add_term_new, where possible