Removed dependency on jcommons.functional by rewriting the corresponding
methods. Need a bit more memory though.