Added a custom Exception and changed the die() statements to use that. Also added an option to change the timestamp format in the constructor.