moved mediumizeMary cleaner function into shared file; made api.coffee use it for maximum resilience