Echo: a C library for bunch longitudinal and transverse dynamics