Adding buffer lib and tests