Merge all other contributions

New features
Fix Windows bugs
Because _sincedb_write can be call from external and must write now and not later.