The Finite State Projection approach for the solution of the master equation and its applications to stochastic gene regulatory networks