Reorganize into ext folder. Fix issue with rake by checking for defined? before import.