Text this: Efficient calculation of self magnetic field, self-force, and self-inductance for electromagnetic coils with rectangular cross-section