added safer strlcpy to deal with null terminating field lengths better. updated API, tests and makefiles