Based of Codeigniter 2.1-stable branch.