moved helper files from /model to /lib, cleaned and consolidated. Also removed functions in model/app.rb, replaced calls to it.