Implement error handling with custom Error enum and thread-local storage for tracking last error message to improve FFI interoperability.
- establish basic Rust project layout. - move all old code into independent directory.