Increased needed memory for APC to 512M + code cleanup

- Increased the needed memory for APC to 512M as we often run into memory problems on our 256M box
- fixed the RAM calculation to divide by 1024 and not 1000
- code cleanup (renaming variables and creating new to avoid magic numbers)
Merge pull request #786 from individual-it/master

Increased needed memory for APC to 512M + code cleanup