Added support for MySQL database as main storage;

Added example of using foreach method in view (so ugly);
Clean up the code.