simplify timeout logic
lots and lots of style fixes
0.4.0