allow chaining on clear method. also a test

fixes issue #5