Collections support

Add support for retrieving and modifying collections via the API.