Constructor caching

Well it contains the rebase to current master :)