Major progress but unresolved compilation problem due to mad generics

Signed-off-by: Matthias Stevens <matthias.stevens@gmail.com>