Implemented custom value renderers

Work in progress, don't merge yet.

This resolves #287.