Minor changes to support restify ~2.6.0
Add close method which closes all resources.

It seems that recent restify versions will leave
sockets open and the app won't end without explicitly
calling close to the restify client. Since each
resource has its own client, we need a way to call
the close method on each client.
Fix valid check.

It was not executing the valid function before,
it was just checking to see if it existed.