Add loopback test
Better compile-time configurability