Added support for 'projects', plus some fixes and optimizations.