[gulp] refactor sources. Partly refactor tests