Change to using macros. Add unit test for vsprintfa