release 0.4.0
Added licenses in all files.
Fixed some issues related to $apply in progress error.