Started on some memory management for parsers

Due to the constraints of the simple dom html parser, the application
can run out of memory. Did some cleaning functions but in some cases
not enough. Queuing system will need to be implemented.