added smoothing in plot_monitor
fixed tests broken by pyflakes update
refactored restrict_instances
better support for viewing weights from .mat files