do not assert inside library, return "nil, error"

also, add metatable to client for oo-styled access.