Refactor PlatformTree

Refactoring PT as per recent post to ML. Also includes parts of lpc17xx PT that I worked on earlier.