Refactored dispose methods.

Shouldn't be an issue, will have to memory profile later on to be 100% sure.
Split up the actionqueue over two files (queue and states) so it's more readable.