create a WebSql result wrapper and unit tests + restructuring