jamesu's console func refactor

Contains #81 and #664 merged with current dev head. All appears to be in order. Testing will be achieved by merging this into the 37 branch and letting people find breakages.