Implement characteristic polynomial

Implement characteristic polynomial using `berkowitz`'s algorithm. Only the coefficients of the characteristic polynomial are returned, not the characteristic polynomial itself.
Thanks, I moved it to the header file.