Let PHP manage memory
Code style improvements and TODOs!