Javascript Boolean functions parser