Implement clear API (closes #1)