I ended up writing my own function to do this.
Full source code here!
Wiki Link: The Solus Project
Rama