[Core/Components]: More fixes for memory issues

Fixes for segfaults and other memory issues in the core classes and components.
Everything runs now, but I still need to iron out a few logic errors.

Signed-off-by: Sebastian Lenartowicz <slenarto@uoguelph.ca>