A few bug fixes.
Implemented O_RDONLY, O_WRONLY, and O_RDWR flags.
Fixed a page allocation bug in AllocMem. Simplified AllocMem code.