Bump to 0.4.0,  Add changes from recent commits