Make the multi-get calls throw 400 errors on invalid input

Also refactor ways and relations to use the same structure as nodes.

This eliminates some 500 errors and brings the rails port, cgimap and the wiki docs closer together.