Optimize And, Or: a&(b&c) -> a&b&c
Moved main() to separate file
for_all_combinations added to util.cpp