This includes documentation and other modifications by Lukasz Marek and Martin Storsjö. Signed-off-by: Martin Storsjö <martin@martin.st>