Init source
Rewrite to js, make module