Tmp/composite

1) re-implemented composite support, should be simpler and easier to use now
2) did some other code refactoring