Fixed up memory leaks.
Started implementing Export action.
Export complete.