Feature/union

This is a first implementation of the union feature. Please review and provide feedback or merge.