Complete refractoring

Went back to original app and use new code. Working copy on Hostgator.