issue 18: protect against dos attacks using entities

Added some options to limit entity expansion, with default values that should prevent most cases.
Also fixed some defects on documentation.