Added exception declarations and half implementation for insert.
Merge.