Fixed AddOnTerminate and added DeleteOnTerminate

Also added $DEFINE PS_ADDONTERMINATE to detect its definition in external scripts and includes.
Merge pull request #186 from idynin/master

Fixed AddOnTerminate and added DeleteOnTerminate
Added Insert, Append, and Delete for PS.

They are magic functions that work with strings and any arrays.

- Added Insert(Arr or Str, Item, Index)
- Added Delete(Arr or Str, Index, Count)
- Added Append(Arr or Str, Item)