Validation of a multi-layer Green's function code for ion beam transport