Refactor runtime create and history

This does not change functionality, it just refactors runtime.History and runtime.Create to make it much cleaner and smaller.