added defines library and tests for it