Clone of https://linqjs.codeplex.com/