Fix base::waitable_event

* Remove unnecessary comments
* Refactor the code (move implementation to source file)
* Add tests