Now with inlined tests; broke the thing into more files