UART decoder improvements

Here's a series of improvements and cleanups for the UART decoder.

Most important part of these are the handling of baudrates. The decoding is now a lot more robust when the sample rate is lower (even works somewhat when the sampling rate is only twice the baudrate, for example) and the rounding errors of a sampling rate that is not an exact multiple of the baudrate are reduced.

In addition, I made the inversion/inverting options a bit more clear and complete.

I've tried to conform to your coding style as far as possible, but it's not my usual style, so I will probably have missed a few spots. I've tried to make the commits as small and well-documented as possible, I hope that makes review easy (even though the number of commits might seem daunting at first....).

Finally, I think this series of patches is finished, but I haven't done a complete review of them before creating this pullrequest. I'll try to do that tomorrow, but I didn't want to keep you from having a look at the commits already. I have an idea for a easy optimization of the findEdge function, but I'll send that over separately if I get around to it.