Added serialization support and improved cross-platform resource handling