Updated PHP array, improved js dir class