Move len/clear from trait implementations to inherent methods

Rust has removed them due to collections reform RFC:

RFC: https://github.com/rust-lang/rfcs/pull/235/files
Commit:
https://github.com/rust-lang/rust/commit/21ac985af44f4e2470ef6f4c0eb4d72daf5a6497