This is a combination of several refactorings and re-thinkings of the
whole library and I think there is not much value in providing the whole
history there.
So this is just a "dump code in" commit.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>