Computer Simulations of Phase Transitions and Dynamics in Confined Systems