Lots of bug fixes / features added including support for profiling