Released version 0.4.0

Changes in API to better support new features, should be backward compatible.