Cleaned up code, began Rails alterations