Major refactoring and overhaul, base code completely changed.