I was a terrible sleeper, so I spent a year throwing a bunch of smart tech at the problem, and it actually worked. Here’s ...