Better code

As part of https://github.com/Fullscreen/raid/issues/28

@stavro This might look like a big pull request, but it's split into individual, independent commits.
I invite you to review them one by one in chronological order (just like GitHub displays them here below).

If any of them does not make sense I can just remove it and keep the rest.