libbase and some simple test code