Add SerializableAttribute to Exceptions.
Add Dispose funcionality and move DllImport methods to NativeMethods class.