Lambda interface support

This is a bit cleaner implementation based on Jacob Lewallen implementation from pull request #12