Fix 'undefined' bucket type issue.

This was broken by #970. The client is not required to send a bucket-type in the request, therefore it can be the atom 'undefined', which corresponds to the "default" bucket-type. Also untangled the logic into a separate "check" for the presence of the bucket-type.

This was found by the Python client suite here: http://buildbot.bos1/builders/python-client-test/builds/60/steps/make%20test/logs/stdio

Also updated tools.mk.

@kellymclaughlin 
How about adding specs to these new functions?