Small refactor. Remove tabs.
Fix a bug in the yield value.
Move out memoized functions.
Merge pull request #160 from aplanas/master

Mainly refactory stuff, but contains an one liner fix that is hitting now.