Port more functions to FFI.
Added eventlogrecord struct.
Added and updated some registry functions, and use ansi functions for now.