Update summarizer.py

dealing in sparse matrices as far as possible by using custom functions where needed. Try catch blocks and WARs for catching memory related errors. Documentation needs cleaning.