Merged with my working copy. Some critical issues 
with performance/leaks fixed, some things improved, some cleaned up,
some for-native optimization added.